﻿
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Utils.Common;

namespace Utils.Common
{
    public class ConfigHelper
    {   


        /// <summary>
        /// 文件序列化
        /// </summary>
        public static bool Serialize<T>(T t)
        {
            string fileName = string.Format(ConfigBase.FromatString, ConfigBase.Root, ConfigBase.Config, t.GetType().Name);
            return FileHelper.Serialize(t, fileName);
        }
        /// <summary>
        /// 文件反序列化
        public static T BackSerialize<T>(T t) where T : ConfigBase
        {
            string fileName = string.Format(ConfigBase.FromatString, ConfigBase.Root, ConfigBase.Config, t.GetType().Name);
            return FileHelper.BackSerialize<T>(fileName);
        }




    }
}
